import numpy as np


class ErrorAnalysis:
    
#     def __init__(self,q_table = []):
#         self.q_table = q_table
        
    def getAverage(self,matrix):
        count = 0
        i = 0
        col1 = [c[0] for c in matrix]
        col2 = [c[1] for c in matrix]
        sum1 = sum(col1)
        sum2 = sum(col2)
        len1 = len(col1)
        len2 = len(col2)
        totalLen = len1 + len2
        totalSum = sum1 + sum2
        ave = totalSum / totalLen
        return ave

    def getTable(self):
        return self.q_table